<?php

namespace app\components\helpers;

class MappingHelper
{

    /**
     * 数据授权
     */
    const DATA_FOR_SELF_ADN_SUB = 1;
    const DATA_FOR_ALL = 2;
    const DATA_FOR_SELF = 3;
    const DATA_FOR_DEPT_ALL = 4;
    const DATA_FOR_CUSTOM = 5;

    /**
     * 数据授权
     * @return array[]
     */
    public static function dataAuthList()
    {
        return [
            ['id' => self::DATA_FOR_SELF_ADN_SUB, 'name' => '自己和下属'],
            ['id' => self::DATA_FOR_ALL, 'name' => '所有人'],
            ['id' => self::DATA_FOR_SELF, 'name' => '仅自己'],
            ['id' => self::DATA_FOR_DEPT_ALL, 'name' => '部门所有人'],
            ['id' => self::DATA_FOR_CUSTOM, 'name' => '自定义'],
        ];
    }

    /**
     * 状态
     */
    const STATUS_ACTIVE = 1;
    const STATUS_INACTIVE = 0;

    /**
     * 状态
     * @return array[]
     */
    public static function statusList()
    {
        return [
            ['id' => self::STATUS_ACTIVE, 'name' => '启用'],
            ['id' => self::STATUS_INACTIVE, 'name' => '禁用'],
        ];
    }

    const FIELD_WRITE_AND_READ = 1;
    const FIELD_READ = 2;
    const FIELD_READ_MD5 = 3;
    const FIELD_INVISIBLE = 4;

    /**
     * 字段权限
     * @return array[]
     */
    public static function fieldAuthList()
    {
        return [
            ['id' => self::FIELD_WRITE_AND_READ, 'name' => '读写'],
            ['id' => self::FIELD_READ, 'name' => '只读'],
            ['id' => self::FIELD_READ_MD5, 'name' => '只读密文'],
            ['id' => self::FIELD_INVISIBLE, 'name' => '不可见'],
        ];
    }

    const SEX_UNKNOWN = 0;
    const SEX_MALE = 1;
    const SEX_FEMALE = 2;

    /**
     * 性别
     * @return array[]
     */
    public static function sexList()
    {
        return [
            ['id' => self::SEX_UNKNOWN, 'name' => '未知'],
            ['id' => self::SEX_MALE, 'name' => '男'],
            ['id' => self::SEX_FEMALE, 'name' => '女'],
        ];
    }

    const ROLE_SELF = '本人';
    const ROLE_PARTNER = '伴侣';
    const ROLE_CONFIDANTE = '闺蜜';

    public static function roleList()
    {
        return [
            ['id' => self::ROLE_SELF, 'name' => '本人'],
            ['id' => self::ROLE_PARTNER, 'name' => '伴侣'],
            ['id' => self::ROLE_CONFIDANTE, 'name' => '闺蜜'],
        ];
    }
}